# import json
#
# str="MY name is haojie.I am 20 year old"
# print(str.upper())
# print(str.lower())
# #第一题
#
# list=['A','b',1,2,"李"]
# for i in list:
#     print(i,end=" ")
# print('\n')
# # 第二题
#
# dic={1:'历史书',2:'语文书',3:'数学书'}
# for i,c in dic.items():
#     print(i,end=":")
#     print(c)
# # 第三题
#
# import json as js
# dic={1:'历史书',2:'语文书',3:'数学书'}
# Json_data=js.dumps(dic)
# print(type(Json_data))
# with open("dic.json","w")as f:
#     json.dump(dic,f)
# 第四题

#
# list1 = [1, 2, 3, 4]
# # 打开文件用于写入，如果文件不存在则创建
# with open('list.txt', 'w') as file:
#     # 写入列表1
#     for item in list1:
#         file.write(str(item)+ ' ')  # 将数值转换为字符串并写入
# print("数据已保存到list.txt文件中。")
# list1_read = []
# with open('list.txt', 'r') as file:
#     # 读取整个文件内容
#     content = file.read()
#     for i in content:
#         list1_read.extend(i)
# print(list1_read)
# # 第四题

# import csv
#
# # 创建CSV文件并写入数据
# with open('people.csv', 'w', newline='') as file:
#     writer = csv.writer(file)
#     writer.writerow(['Name', 'Age'])  # 写入标题行
#     writer.writerow(['Alice', 25])  # 写入第一行数据
#     writer.writerow(['Bob', 30])  # 写入第二行数据
#     writer.writerow(['Charlie', 35])  # 写入第三行数据
#
# # 从CSV文件读取数据并打印
# with open('people.csv', 'r') as file:
#     reader = csv.reader(file)
#     for row in reader:
#         print(f'Name: {row[0]}, Age: {row[1]}')
# # 第5题

from datetime import datetime

# 获取当前时间
current_time = datetime.now()

# 格式化输出
formatted_time = current_time.strftime("%m月%d日 星期:%A")
print(formatted_time)


float_list = [1.23456, 2.34567, 3.45678]

for num in float_list:
    rounded_num = round(num, 2)
    print(rounded_num)
# (1)
float_list = [1.23456, 2.34567, 3.45678]

for num in float_list:
    formatted_num = "{:,}".format(num*10**10)
    print(formatted_num)
# (2)